home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_5.lha / 5_5 / 5_5c3sth.h < prev    next >
Text File  |  1993-08-08  |  1KB  |  57 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  6. * The C++ Answer Book */
  7. * Tony Hansen */
  8. * All rights reserved. */
  9. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  10. * The C++ Answer Book */
  11. * Tony Hansen */
  12. * All rights reserved. */
  13. / stackalloc.h
  14. / Manage a location on the stack.
  15. / WE32100 version.
  16. / Uses class intalloc to find
  17. / the location.
  18.  
  19. ifndef STACKALLOC_H
  20.  define STACKALLOC_H
  21.  
  22. ifdef NONLOCAL        /* DELETE */
  23. include <intalloc.h>
  24. else        /* DELETE */
  25. include "intalloc.h"    /* DELETE */
  26. endif        /* DELETE */
  27. include <stream.h>
  28.  
  29. lass stackalloc
  30.  
  31.    int loc;
  32.    const intalloc *ia;
  33.  
  34. ublic:
  35.    stackalloc(const intalloc *a) :
  36. ia(a)
  37.    {
  38. loc = a->get();
  39.    }
  40.  
  41.    ~stackalloc()
  42.    {
  43. ia->free(loc);
  44.    }
  45.  
  46. ifdef USE8086    /* DELETE */
  47. include "5_5c3sth6.h"    /* DELETE */
  48. else    /* DELETE */
  49.    ostream &print(ostream &out)
  50.    {
  51. out << (loc * 4) << "(%sp)";
  52. return out;
  53.    }
  54. endif    /* DELETE */
  55. ;
  56. endif /* STACKALLOC_H */
  57.